const Router = require('koa-router')
const userRouter = new Router({prefix: '/users'})
const { verifyUser, handlePassword } = require('../middleware/user.middleware')
const {
    create,
    update,
    getUserDetailById,
    updateUserInfo
} = require('../controller/user.controller')
const { verifyPermission,verifyAuth } = require('../middleware/auth.middleware')

userRouter.get('/:userId',verifyAuth, getUserDetailById)
userRouter.post('/',verifyUser, handlePassword, create)
userRouter.patch('/', verifyAuth, update)
userRouter.patch('/update', verifyAuth, updateUserInfo)


module.exports = userRouter
